﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for AirfareTypeBusiness
/// </summary>
public class AirfareTypeBusiness
{
	public AirfareTypeBusiness()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public DataTable getAllAirfareType()
    {
        return DataAccess.DataTable_Query("exec sp_GetAirfareType '0'");
    }

    public AirfareTypeEntities getAirfareType(int airfareTypeID)
    {
        AirfareTypeEntities ate = new AirfareTypeEntities();
        DataTable dt = DataAccess.DataTable_Query("exec sp_GetAirfareType '" + airfareTypeID + "'");
        if (dt != null)
        {
            DataRow dr = dt.Rows[0];
            ate._airfareTypeID = int.Parse(dr["airfareTypeID"].ToString());
            ate._airfareTypeName = dr["airfareTypeName"].ToString();
            ate._airfareTypeFactor = Convert.ToDouble(dr["airfareTypeFactor"].ToString());
        }
        return ate;
    }
}